﻿#include <QtGui/QGuiApplication>
#include <QUrl>
#include "mainwindow.h"
#include "upmainwindow.h"
#include <QQmlContext>

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    //注册opengl到qml
    qmlRegisterType<MainWindow>("MainWindow", 1, 0, "MainWindow");
    qmlRegisterType<UpMainWindow>("UpMainWindow", 1, 0, "UpMainWindow");

    QQuickView view;
    view.setFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
    view.setColor(QColor(Qt::transparent));

    view.setSource(QUrl("qrc:/main.qml"));
    view.setTitle(QStringLiteral("opengl and qml"));
    view.setWidth(400);
    view.setHeight(300);
    view.show();
    view.rootContext()->setContextProperty("view", &view);

    return app.exec();
}
